package com.lagou.utils;

import com.lagou.config.Resources;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

/**
 * desc:
 *
 * @author tengfei wang
 * @version 1.0
 * @date Created in 13/9/2020
 */
public class PropertyUtils {

    public static String getProperty(String path, String name) {
        InputStream inputStream = Resources.getResourceAsInputStream(path);
        String value = null;
        try {
            Properties properties = new Properties();
            properties.load(inputStream);
            value = properties.getProperty(name);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return value;
    }
}
